<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<audio controls  autoplay id="player"></audio> <button onclick="start()">加载音乐</button>
</body>
<script type="application/javascript">
    function start() {
        var player = document.getElementById("player");
        player.src = "https://m801.music.126.net/20190605173425/f174758d3ead88bd583e00308499d613/jdyyaac/000e/0759/025b/7dbcac32620333068c3951c2209f69a4.m4a";
        player.onended = function () {
            alert("播放完成");
        };
    }
</script>
</html>